<script type="text/javascript" src="/admins/js/jquery/jquery-1.7.2.min.js"></script>
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>

<link href="/css/home/warehouse.css" media="screen" rel="stylesheet" type="text/css" >
<link href="/admins/css/common.css" media="screen" rel="stylesheet" type="text/css" >
<link href="/admins/css/adminshare.css" media="screen" rel="stylesheet" type="text/css">     
<script type="text/javascript" src="/admins/js/jquery/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="/js/jquery.validate.min.js"></script>
<script type="text/javascript" src="/js/messages_cn.js"></script>
<script type="text/javascript" src="/js/uuch.js"></script>

<style>
	.datatable {
                width:90%;
		text-align: left;
		font-size: 12px;
		font-family: verdana;
		background: #c0c0c0; margin:2px;
	}

	.datatable thead tr,

	.datatable tfoot tr {
		background: #c0c0c0;
	}

	.datatable tbody tr {
		background: #f0f0f0;
                height: 16px;
	}

	.datatable td, .datatable th {
		border: 1px solid white; height:28px;
	}
	.datatable td {background-color:white;}
	
	.datatable .hover td {background-color:#99CCFF;}
	
	.datatable .select td {background-color:#EEEE99;}
        .zinx{
            width: 80px;
            padding:2px 0px;
        }
        .ziny{
            width: 90px;
            background-color: white;
            color: #0188CC;
            position: absolute;
            z-index: 1;
            top: -5px;
            left: -72px;
            -webkit-border-radius: 2px;
            -moz-border-radius: 2px;
            border-radius: 2px;
            box-shadow: 0 5px 4px rgba(0, 0, 0, 0.25);
        }
	#ui-datepicker-div{ font-size:12px;}
        .zinx .current-item{color:#0188cc;padding:2px 0px;font-size:12px;cursor:pointer;display:inline-block;zoom:1;line-height:17px;height:17px}
        .zinx .current-item2{color:#0188cc;padding:2px 0px;font-size:12px;cursor:pointer;display:inline-block;zoom:1;line-height:17px;height:17px}
        .zinx .current-item{padding:1px 6px;border:1px solid #f47c02;color:#fff;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;background:#f99236;background:-moz-linear-gradient(top,#fa9b3d 0,#f99236 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#fa9b3d),color-stop(100%,#f99236));background:-webkit-linear-gradient(top,#fa9b3d 0,#f99236 100%);background:-o-linear-gradient(top,#fa9b3d 0,#f99236 100%);background:-ms-linear-gradient(top,#fa9b3d 0,#f99236 100%);background:linear-gradient(top,#fa9b3d 0,#f99236 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FA9B3D',endColorstr='#F99236',GradientType=0)}
        .zinx .icon-pull-down{display:inline-block;zoom:1;width:14px;background:url(/images/share/2J1MJYfSjp.png) no-repeat 3px -33px;}
        .zinx .icon-pull-down2{display:inline-block;zoom:1;width:14px;background:url(/images/share/2J1MJYfSjp.png) no-repeat 3px -33px;background-position:3px 7px;}
        .normal-list{background-color:#fff;color:#0188cc;position:absolute;z-index:1;top:-8px;left:-5px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;box-shadow:0 5px 4px rgba(0,0,0,0.25);width:80px;padding:2px 0px;}
        .normal-list li{border-left:1px solid #c4c4c4;border-right:1px solid #c4c4c4;cursor:pointer;line-height:21px;height:21px;padding:0;text-align:right;position:relative;overflow:hidden}
        .normal-list li.first{border-top:1px solid #c4c4c4;border-radius:3px 3px 0 0;line-height:19px;height:20px}
        .normal-list li.last{border-bottom:1px solid #c4c4c4;border-radius:0 0 3px 3px;line-height:19px;height:20px}
        .normal-list .normal-list{overflow-x:hidden;overflow-y:auto}
        .normal-list .normal-list .split{border-top:1px solid #e9e9e9;line-height:20px;height:20px}
        .normal-list li:hover{line-height:19px!important;height:19px!important;color:#fff;border:1px solid #f47c02!important;background:#fa9b3d;background:-moz-linear-gradient(top,#fa9b3d 0,#f99236 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#fa9b3d),color-stop(100%,#f99236));background:-webkit-linear-gradient(top,#fa9b3d 0,#f99236 100%);background:-o-linear-gradient(top,#fa9b3d 0,#f99236 100%);background:linear-gradient(top,#fa9b3d 0,#f99236 100%)}
        .normal-list li:hover a{color:#fff}
        .normal-list li a,.normal-list li span{display:block;padding-right:20px}
        .normal-list li a:hover{text-decoration:none}
        .normal-list li.active{background-color:#f99236;background-color:-ms-linear-gradient(top,#fa9b3d 0,#f99236 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FA9B3D',endColorstr='#F99236',GradientType=0)}
        .normal-list .active,.normal-list .active a,.normal-list .active span{color:#fff}
        .dataTable{
            background-color: #FFFFFF;
            width:99%;
        }
</style>
<div style="padding:2px; margin:2px;" class="dataTable">
    
<table cellspacing="1" width="100%" class="datatable" id="waybill-table">
	<thead>
		<tr>
			<th class="w0" style="width:150px;">悠奇运单编号</th>
                        <th class="w1">运送方式</th>
			<th class="w0">目的地</th>
                        <th class="w1">物品净重(kg)</th>
                        <th class="w0">预付款</th>
                        <th class="w1">发货渠道/单号</th>
                        <th class="w0">转单号</th>
                        <th class="w1">状态</th>
		</tr>
	</thead>
    <tfoot>
      <tr></tr>
    </tfoot>
	<tbody>
                <?php
                    if( $this->billlist != ''){
                    foreach ($this->billlist as $key => $Item) {?>
                    <tr>
                        <td class="w1" style="padding:0 10px;width: 150px;"><a href="/admini/managewaybill/billaccep/id/<?php echo $Item->id;?>" target="_blank" class="indexa"><?php echo $Item->billNo;?></a><br><?php echo $Item->dateCreated;?></td>
                        <td class="w1" style="padding:0 10px;"><?php echo $Item->ExpressBy!=null?$Item->ExpressBy->name:"";?></td>
                        <td class="w0" style="padding:0 10px;"><?php echo $Item->UserCity?$Item->UserCity->name:"";?></td>
                        <td class="w0" style="padding:0 10px;"><?php echo $Item->productWeight/1000;?></td>
                        <td class="w0" style="padding:0 10px;">￥<?php echo $Item->shipMoney;?></td>
                        <td class="w1" style="padding:0 10px;"><?php echo $Item->agentname!=null&&$Item->agentname->name?"[".$Item->agentname->name."]".$Item->agentNo:"暂无";?></td>
                        <td class="w0" style="padding:0 10px;"><?php echo $Item->logistics?$Item->logistics:"暂无";?></td>
                        <td class="w1" align="center" style="width:128px;"><?php echo $Item->statusname;?></td>
                    </tr>
                <?php } }?>
	</tbody>
</table>
<script>
    $('#waybill-table .zinx').mousemove(function(){
       var name = $(this).attr('name'); 
       $('#waybill-table #zinx'+name).attr("style","display:none;");
       $('#waybill-table #ziny'+name).attr("style","display:block;");
    });
    $('#waybill-table .ziny').mouseleave(function(){
       var name = $(this).attr('name'); 
       $('#waybill-table #zinx'+name).attr("style","display:block;");
       $('#waybill-table #ziny'+name).attr("style","display:none;");
    });
    $("#waybill-table #cancel").on('click',function(){
        var billid = $(this).attr('name');
        if(confirm("您确定该运单退货？","提示信息")){            
            $.ajax({    
                type: 'POST',
                url: '/admini/managewaybill/cancel/id/'+billid,
                success: function(data) {
                    if(data == 2){
                        alert("退货成功！");
                    }else if(data == 22){
                        alert("只能撤销未受理和受理中的运单");
                    }else{
                        alert("发生未知错误，请重新操作");
                    }
                    location.href='/admini/managewaybill/index';
                }
            });
        }
        return false;
    });
    
</script>
 <?php
    echo $this->partial('paging.phtml', array("pages" => $this->billall,"pamas"=>"username=".$this->username."&storeno=$this->storeno&dateselect=$this->dateselect&starttime=$this->starttime&endtime=$this->endtime&status=$this->status"));        
?>
</div>
